package com.nulstudio.sppm.Dao;

import com.nulstudio.sppm.Entities.Commodity;
import com.nulstudio.sppm.Entities.SupplierInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CommodityMapper {

    public List<Commodity> getAllCommodities();

    @Options(useGeneratedKeys = true, keyProperty = "id")
    public int addCommodity(Commodity Commodity);
    public int deleteCommodity(int id);
    public int getIdByInfo(Commodity info);
    public int modifyCommodity(Commodity request);
    public int getLastId();
    public Commodity getCommodityById(@Param("id")int id);
    public int getCommodityIdByName(@Param("name")String name);
}
